package vns.server.domain;


import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import vns.shared.ObjectDTO;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")

public class Object {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key id;
	
	@Persistent
	private String status;
	
	@Persistent
	private String otype;

	public Object(ObjectDTO objectDTO){
		this.status = objectDTO.getStatus();
		this.otype = objectDTO.getOtype();
	}
	
	public void updateFromDTO(ObjectDTO objectDTO){
		this.status=objectDTO.getStatus();
		this.otype = objectDTO.getOtype();
	}
	
	public ObjectDTO toDTO(){
		ObjectDTO objectDTO=new ObjectDTO(this.id,this.otype, this.status);
		return objectDTO;
	}
	
	public Key getId(){
		return id;
	}
	
	public String getStatus(){
		return status;
	}
	
	public void setStatus(String Status){
		this.status=Status;
	}

	public void setOtype(String otype) {
		this.otype = otype;
	}

	public String getOtype() {
		return otype;
	}
	
	
	

}
